package com.ruoyi.web.controller.system;

import com.ruoyi.system.domain.IntepralSetting;
import com.ruoyi.system.service.IntepralSettingService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * (IntepralSetting)表控制层
 *
 * @author makejava
 * @since 2021-02-27 08:47:32
 */
@RestController
@RequestMapping("system/intepralSetting")
public class IntepralSettingController {
    /**
     * 服务对象
     */
    @Resource
    private IntepralSettingService intepralSettingService;

    /**
     * 通过主键查询单条数据
     * @param id 主键
     * @return 单条数据
     */
    @RequestMapping("selectIntepralSettingById")
    public IntepralSetting selectOne(Integer id) {
        return this.intepralSettingService.queryById(id);
    }

    /**
     * 修改积分规则
     * @param intepralSetting 规则
     * @return
     */
    @RequestMapping("updateIntepralSetting")
    public long update(IntepralSetting intepralSetting){
        return this.intepralSettingService.update(intepralSetting);
    }


    /**
     * 添加积分
     * @param user_id 用户编号
     * @param id 功能编号
     * @return
     */
    @RequestMapping("addIntepral")
    public long addIntepral(String user_id,Integer id){
        return this.intepralSettingService.addIntepral(user_id,id);
    }

    /**
     * 减积分
     * @param user_id 用户编号
     * @param id 功能编号
     * @return
     */
    @RequestMapping("reduceIntepral")
    public long reduceIntepral(String user_id,Integer id){
        return this.intepralSettingService.reduceIntepral(user_id,id);
    }

}
